<?php

class AddressForm extends CFormModel
{
	public $country;
	public $province;
	public $city;
	public $district;
	public $name;
	public $zipcode;
	public $telephone;
	public $address;

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('country, province, city, district, name,zipcode,telephone,address', 'required'),
		);
	}


	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
		);
	}

	
	/**
	 * @return array sex type names indexed by type IDs
	 */
	public function getCountryOptions()
	{
		return array(
			0=>'中国',
		);
		
	}
	
	/**
	 * @return string the Country name display for the current country
	 */ 
	public function getCountryText()
	{
		$countryOptions=$this->countryOptions;
		return isset($countryOptions[$this->country]) ? $countryOptions[$this->type_id] : "unknown country ({$this->country})";
	}
}